<?php
$dis_id=2;
include("../../inc/conn.inc");
include("../islogin.php");
$check_rs=@mysql_query("select m_type from member where id='".$_COOKIE['user_id']."'");
$check_row=@mysql_fetch_array($check_rs);
if($check_row[m_type]==3){

echo "<script>alert('此功能对钻石会员开放');location='costom_type.php';</script>";
}

?>
<?php
if($_POST[tj_act]&&$_POST[type_id]){
$type_id=explode("@",$_POST[type_id]);
mysql_query("insert into web_list (member_id,w_type_id,w_name) values ('".$_COOKIE['user_id']."','$type_id[0]','$type_id[1]')");

echo "<script>location='costom_type.php';</script>";
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-三帝贸易网</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/left.js"></script>
<body>
<div id="mian">
<?php include("../inc/top.php");?>
<div class="top1"><span>您当前位置：<a href="../index.php" class="dh">会员助手</a> &gt;&gt; 企业网站配置 &gt;&gt; 添加网站列表分类</span></div>
<div class="left">
<?php include("../inc/left.php");?>
</div>
<div class="right">
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
   <TR>
     <TD height="40" bgcolor="#EFF6FF" style="font-size:18px;font-weight:bold;padding-left:8px;">添加网站列表分类</TD>
   </TR>
</TABLE>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#C1DCF5">
	  <form method="post" action="" onSubmit="return check()">
        <tr>
          <td height="35" colspan="2" align="center" bgcolor="#EFF6FF">添加网站列表分类</td>
        </tr>
        <tr>
          <td width="24%" height="35" align="center" bgcolor="#EFF6FF">列表分类名称</td>
          <td width="76%" bgcolor="#FFFFFF"><select name="type_id" id="type_id">
		  <option value="">--选择分类--</option>
		<?php
		$rs=mysql_query("select id,web_list_name from web_a_list order by id");
		while($row=mysql_fetch_array($rs)){
		   $w_rs=@mysql_query("select count(id) from web_list where member_id='".$_COOKIE['user_id']."' and w_type_id='".$row['id']."'");
		   $num=@mysql_result($w_rs,0);
		   @mysql_free_result($w_rs);
		  if($num==0){
		?>
		  <option value="<?=$row['id']?>@<?=$row[web_list_name]?>"><?=$row[web_list_name]?></option>
		<?php }}?>
		</select>
		</td>
        </tr>
        <tr>
          <td height="35" align="center" bgcolor="#EFF6FF">&nbsp;</td>
          <td bgcolor="#FFFFFF"><input type="submit" value=" 提交 "></td>
        </tr><input type="hidden" name="tj_act" value="ok">
		</form>
    </table>
</div>
<div class="onl"></div>
<?php include("../inc/foot.php");?>
</div>
</body>
</html>

<script language="javascript">
function $(id){
return document.getElementById(id);
}
function check(){
if($("type_id").value==""){
alert("分类不能为空");
return false;
}
}
</script>